<template>
	<view>
		
		<view class="header">
			
			<text id='title'>我的待办</text>
		</view>
		
		<view class="content" v-for="v in sbdata" :key='v.sb_id'>
			<view >
				<view>水表号</view>
				<view>单位名称</view>
				<view>地址</view>
			</view>
			<view  @click="goCb(v)" id="rightView">
				<view>{{v.sb_num}}</view>
				<view>{{v.qy_name}}</view>
				<view>{{v.qy_dazhi}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {ref,toRefs,reactive,onMounted} from 'vue'
	import http from '../../utils/http.js'
	import{mapState,useStore} from 'vuex'
	export default {
	
			
				setup(){
						const{state,getters,commit,dispatch}=useStore();
					let data=reactive({
						sbdata:[
							{
								shuibiaoid:'054344934',
								danweiname:'美的家用空调有限公司',
								dizhi:'人民南路330号'
							},{
								shuibiaoid:'054344934',
								danweiname:'美的家用空调有限公司',
								dizhi:'人民南路330号'
							}
						],
						getdb(){
							http({
								url:'/miniwatermeter/getMeterReading',
								method:'get'
							}).then((res)=>{
								console.log(res)
								data.sbdata = res.data.data
							})
						},
						goCb(v){
							console.log(v)
							commit('chaobiao/setTodolistInfo',v)
							uni.navigateTo({
								url:"./Meterreader"
							})
						}
					});
					onMounted(()=>{
						data.getdb()
					});
					
					return{...toRefs(data)}
					
				}
	}
</script>

<style>
	#rightView{
		text-align: left;
		width: 380rpx;
	}
.header {
		display: flex;
		justify-content: flex-start;
		width: 100%;
		height: 100rpx;

		align-items: center
	}

	#titlef {
		color: #3C9CFF;
		margin-left: 30rpx;
	}

	#title {
		position: absolute;
		left: 295rpx;

	}
	.content{
		border: 1rpx solid black;
		display: flex;
		justify-content: space-between;
		
	}
</style>
